# Shared Configs

## Schema Configs

|                                                                   Name                                                                   | Description                                                                                               |
| :--------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------- |
| [`flat/schema-recommended`](https://github.com/dimaMachina/graphql-eslint/tree/master/packages/plugin/src/configs/schema-recommended.ts) | enables recommended rules for schema development                                                          |
|         [`flat/schema-all`](https://github.com/dimaMachina/graphql-eslint/tree/master/packages/plugin/src/configs/schema-all.ts)         | enables all rules for schema development, except for those that require `parserOptions.operations` option |
|       [`flat/schema-relay`](https://github.com/dimaMachina/graphql-eslint/tree/master/packages/plugin/src/configs/schema-relay.ts)       | enables rules from Relay specification for schema development                                             |

## Operations Configs

|                                                                       Name                                                                       | Description                                                              |
| :----------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------------------------ |
| [`flat/operations-recommended`](https://github.com/dimaMachina/graphql-eslint/tree/master/packages/plugin/src/configs/operations-recommended.ts) | enables recommended rules for consuming GraphQL (operations) development |
|         [`flat/operations-all`](https://github.com/dimaMachina/graphql-eslint/tree/master/packages/plugin/src/configs/operations-all.ts)         | enables all rules for consuming GraphQL (operations) development         |

> [!TIP]
>
> If you are in a project that develops the GraphQL schema, you'll need `schema` rules.
>
> If you are in a project that develops GraphQL operations (`query`/`mutation`/`subscription`),
> you'll need `operations` rules.
>
> If you are in a monorepo project, you probably need both sets of rules, see
> [example of configuration](https://github.com/dimaMachina/graphql-eslint/tree/master/examples/monorepo/eslint.config.js).

## Config Usage

For example, to enable the `flat/schema-recommended` config, in a new configuration object assign
the `rules` field to the `rules` field from the associated config from `graphqlPlugin.configs`
object.

```diff filename="eslint.config.js"
import graphqlPlugin from '@graphql-eslint/eslint-plugin'

export default [
  // ... other config
  {
    files: ['**/*.graphql'],
    languageOptions: {
      parser: graphqlPlugin.parser
    },
    plugins: {
      '@graphql-eslint': graphqlPlugin
    }
  },
+ {
+   files: ['path-to-schema/**/*.graphql'],
+   rules: graphqlPlugin.configs['flat/schema-recommended'].rules
+ }
]
```
